feat: add message envelope generator#219
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Test Results616 tests 616 ✅ 30s ⏱️ Results for commit 83d9369. ♻️ This comment has been updated with latest results. |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #219 +/- ##
==========================================
+ Coverage 92.00% 96.66% +4.66%
==========================================
Files 259 261 +2
Lines 24357 24557 +200
Branches 3312 3345 +33
==========================================
+ Hits 22409 23739 +1330
+ Misses 865 818 -47
+ Partials 1083 0 -1083
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new Roslyn incremental generator for typed message envelope contracts (required headers + context factory), and updates the messaging example/docs/catalogs so “Message Envelope” no longer has a tracked source-generation gap.
Changes:
- Introduces
[GenerateMessageEnvelope]/[MessageEnvelopeHeader]attributes plusMessageEnvelopeGeneratorwith new diagnosticsPKME001–PKME004. - Expands the Message Envelope example to show fluent vs source-generated paths and adds
IServiceCollectionintegration with updated example/catalog coverage. - Updates documentation and production-readiness catalogs to include the new generator/example and remove the previous tracked gap reference.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/PatternKit.Generators.Tests/MessageEnvelopeGeneratorTests.cs | Adds generator tests for successful generation and expected diagnostics. |
| test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs | Extends attribute-usage/defaults/guard coverage for the new messaging attributes. |
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs | Removes the “Message Envelope generator gap” assertion from production-readiness expectations. |
| test/PatternKit.Examples.Tests/Messaging/MessageEnvelopeExampleTests.cs | Updates example tests to compare fluent vs generated metadata and validate DI import path. |
| src/PatternKit.Generators/Messaging/MessageEnvelopeGenerator.cs | Implements the incremental generator and diagnostics for message envelope factories/context factories. |
| src/PatternKit.Generators/AnalyzerReleases.Unshipped.md | Registers new diagnostic IDs PKME001–PKME004. |
| src/PatternKit.Generators.Abstractions/Messaging/MessageEnvelopeAttributes.cs | Adds new public generator attributes for envelope contracts and required headers. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs | Updates the pattern catalog entry to point at generator/docs/example sources. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs | Adds a new “Generated Message Envelope” example descriptor and updates suite tags. |
| src/PatternKit.Examples/Messaging/MessageEnvelopeExample.cs | Splits example into fluent vs generated runs, adds DI runner/extension, and defines generated contract. |
| src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs | Registers the new generated message envelope example in DI + example registry. |
| docs/patterns/messaging/message-envelope.md | Documents the new source-generated contract option and links to new attributes. |
| docs/guides/pattern-coverage.md | Updates the coverage table to reflect generator availability for Message Envelope. |
| docs/generators/messaging.md | Adds “Generated Message Envelope” generator documentation and diagnostic ID table update. |
| docs/generators/index.md | Adds Message Envelope to the generator index/table and shows a minimal usage snippet. |
| docs/examples/toc.yml | Adds the new “Generated Message Envelope” example page to the examples TOC. |
| docs/examples/index.md | Links and describes the new generated message envelope example page. |
| docs/examples/generated-message-envelope.md | New focused example page documenting runtime vs generated path plus DI integration. |
| docs/examples/enterprise-messaging-workflows.md | Notes the source-generated message envelope option in the workflow suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var headers = GetHeaders(type, context); | ||
| if (headers.Length == 0) | ||
| { | ||
| context.ReportDiagnostic(Diagnostic.Create(MissingHeaders, node.Identifier.GetLocation(), type.Name)); |
Code Coverage |
Summary
Validation
Local targeted test runs still hit the repo's known local analyzer/compiler mismatch (CS9057) and generated example types are unavailable locally; CI is the authoritative full validation.